<!---
	Title:		Duty Roster Page
	Author:		Bruce Frick
	Purpose:	Set the data elements for today's Duty Roster.
--->


<cfset BASE = CreateObject("component", "SharePointModules.apt.cfc.base") />
<cfset QUERIES = CreateObject("component", "SharePointModules.apt.cfc.queries") />

<cfparam default="_AKA-PC 2 East" name="url.clinic" />
<cfparam default="#dateFormat(now(), 'mm/dd/yyyy')#" name="url.date" />

<cfoutput>

#BASE.htmlHeader(
    "/jquery/jquery-1.4.2.min.js,/jquery/js/jquery.tablesorter.min.js,
    ../apt/js/view.js", 
    "../apt/css/main.css", 
    RemoveChars(url.clinic,1,5) & " Roster"
)#

<script type="text/javascript">
    setTimeout('resizeWindow()', 1500);
</script>

<cfset QUERIES.thisRoster = QUERIES.FuncQrySelectRoster(url.clinic, url.date) />

<cfif QUERIES.thisRoster.RecordCount GT 0>
    <table id="roster" border="0" cellpadding="0" cellspacing="0" width="60%">
        <thead>
            <tr>
                <th>Provider</th>
                <th>Resource Code</th>
                <th>Title</th>
                <th>Shift</th>
                <th>Case Manager</th>
                <th>CM Support</th>
                <th>CMA</th>
                <th>Notes</th>
            </tr>
        </thead>
        <tbody>
            <cfloop query="QUERIES.thisRoster">
            <tr>
                <td>#BASE.funcFindAddedStaffName(ProviderID)# &nbsp;</td>
                <td>#ResourceCode# &nbsp;</td>
                <td>#Title# &nbsp;</td>
                <td>#Shift# &nbsp;</td>
                <td>#BASE.funcFindAddedStaffName(CaseManagerID)# &nbsp;</td>
                <td>#BASE.funcFindAddedStaffName(CMSSupportID)# &nbsp;</td>
                <td>#BASE.funcFindAddedStaffName(CMAID)# &nbsp;</td>
                <td>#Notes# &nbsp;</td>
            </tr>
            </cfloop>
        </tbody>
        </table>
        <br />
        <table id="instructions"  width="100%">
            <tbody>
                <tr>
                    <td width="100%">                   
                        <span class=""><strong>Special Instructions</strong></span><br />
                        #QUERIES.FuncQrySelectSpecialInstructions(url.clinic, url.date).SpecialInstructions#
                    </td>
                </tr>
            </tbody>
        </table>
        <cfelse>
        Today's Roster is not yet published.
        </cfif>
    
</cfoutput>


<!--- If the current user is authorized to access the Admin page, provide a link. --->
<cfif (BASE.SCF_IsUserAuthorized(CGI.auth_user, 'PedsRosterAdmin'))>
    <p><a href="admin.cfm" target="_blank">Admin Page</a></p>
</cfif>


<cfoutput>#VARIABLES.base.htmlFooter()#</cfoutput>
